package com.paas.form.core.element.control.impl.searchItem;

import com.paas.form.core.element.control.FormItem;
import com.paas.form.core.element.field.FieLdsModel;
import com.paas.form.core.element.jsContent.ScriptContent;
import lombok.Data;


@Data
public class FormInputItem implements FormItem {
    private FieLdsModel field;

    private String htmlType;

    public static final String EL_INPUT_HTML_old = "<el-input v-model=\"scope.row[item.columnName]\" :placeholder=\"item.placeholder\"\n" +
            "                        :readonly=\"item.readonly\" :prefix-icon=\"item['prefix-icon']\"\n" +
            "                        :suffix-icon=\"item['suffix-icon']\" :clearable=\"item.clearable\"\n" +
            "                        :show-word-limit=\"item['show-word-limit']\" :maxlength=\"item.maxlength\"\n" +
            "                        :show-password=\"item['show-password']\" :disabled=\"item.disabled\">\n" +
            "                        <template slot=\"prepend\"\n" +
            "                          v-if=\"item.schemeSlot && item.schemeSlot.prepend\">{{item.schemeSlot.prepend}}</template>\n" +
            "                        <template slot=\"append\"\n" +
            "                          v-if=\"item.schemeSlot && item.schemeSlot.append\">{{item.schemeSlot.append}}</template>\n" +
            "                      </el-input>";

    public static final String EL_INPUT_HTML ="<el-input v-model=\"${formObject}.${field.vModel}\" placeholder=\"${field.config.label}\" clearable />";

    public FormInputItem (FieLdsModel field,String htmlType){
        this.field = field;
        this.htmlType = htmlType;

    }


    @Override
    public String makeVue() {
        return EL_INPUT_HTML;
    }

    @Override
    public ScriptContent makeJs() {
        return null;
    }
}
